Repository navigation
fix(files): cancel resumed runs across replicas, unify anchored file edits, and harden workspace, integration, and presence paths - #9035
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[High impact] The PR appears safe to merge; no new blocking issue was found. SummaryThis PR fixes resumed-run cancellation across replicas, shares anchored file edits, and hardens file storage, workspace moves, integrations, and presence updates.
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Confidence score: 4/5
- In
file-doc-presence.integration.ts,await Server.close()can continue before the replica has finished closing, so shutting down the store and Redis clients may race with server teardown. Await the close callback first.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/realtime/src/handlers/file-doc-presence.integration.ts">
<violation number="1" location="apps/realtime/src/handlers/file-doc-presence.integration.ts:182">
P2: `Server.close()` completes through its callback, not a returned promise, so this `await` continues before the replica has finished closing. Await the callback before shutting down its store and Redis clients.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
848e59f to
05418f9
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
…very banned-user workspace, and drop dead membership guards - requireForkProject takes the Project lock shared, so sibling file writers and other forks no longer wait out a fork's content copy; exclusive lifecycle holders (archive, split, transfer, departure) are still fenced - disableUserResources keeps archiving after one workspace fails, logs the failed ids, and throws an AggregateError at the end - remove null guards on workspace.project_id, which is NOT NULL - name release v0.9.18 instead of a PR number in Project backfill operator errors - log workspace and workflow ids per archive repair in the 0032 script migration (cherry picked from commit 5831241070f08536eb923a4de012b0a58bdb5ff3)
…, share one anchored edit The end anchor is now the first match after the selected start anchor, so a closing line earlier in the file no longer fails the edit. Copilot's apply_file_edit and its streaming preview route anchored patches through applyWorkspaceFileContentEdit instead of two divergent copies. Anchored edits keep each untouched line's own ending; inserted lines take the anchor's. (cherry picked from commit fb3f81a1b7810c1dc8763f31b5a1479769f60803)
…t by listing the folder resolveScopedFileReference listed up to 5000 files to find one name, so a named write, append, or edit inside a larger folder failed payload_too_large. The id and name lookups are now exact SQL predicates under the same folder scope and list authorization, with the same not-found and ambiguity errors. (cherry picked from commit 63a06782eb3327a6d858bc337600d88d76ce46c8)
… listing every folder id A root scope including subfolders expanded to every active folder id, so file listing and content search sent an IN list of up to every folder in the workspace. It now resolves to no folder scope, which selects the same files: archiving a folder archives the files in it. The two identical folder-scope predicate builders become one workspaceFileFolderScopeCondition. (cherry picked from commit 8020c141e6462cb2c97dfe2c992225ed3baad3ab)
…ms, log context kind only Folder scope narrows a search; authorization is workspace-level, so the comments no longer call it an isolation boundary. A failed chat context now logs its kind rather than the whole context, which for a file selection carries the user's selected text. The overlap-dedupe docstring keeps its invariants. (cherry picked from commit 4c22ff11d982a0f57156746f6d07bce584b1d587)
…e, probe the id alongside folder resolution (cherry picked from commit 0df6468f6372168cfbe9f3668eae213cee091b6c)
…ders, rename untitled files on heading exit - file-upload: drop the effect that pruned out-of-scope selections from every open editor; flag them for removal instead - use-resource-folders: memoize on stable query fields; fix byPath doc - rich-markdown-editor: name an untitled file after its heading when the cursor leaves it, on blur, or on unmount (once), not after an idle pause; caller resolves the file by id - table-grid: hoist guarded context row instead of non-null assertions - drop a formula-restating test and trim a home.tsx comment (cherry picked from commit 419520a1e42c3462b31ccbf2e68f7f8d6af4ae9d)
…another replica The resumed engine subscribes to cancellation under the durable run id, while Stop records it under the attempt id. Subscribe the attempt's abort to its own id, and assert the durable snapshot id through executeWorkflowCore instead of a log message. (cherry picked from commit facbad586a01aaeb624150af896dceb1a6430c47)
…nd fail saved ones without retry (cherry picked from commit 80d07588a0c2b6b5edbd130497471f8f6594b801)
…credentials, as Router and Evaluator do (cherry picked from commit 55eb1c8ba930d006bc130fa2de584dfa0f23291a)
3b34fd8 to
71b2734
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 165 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…ith separators allowed Outlook event and calendar ids share the guarded path-segment helper (type guards, lone-surrogate check, dot-segment rejection) instead of a local copy, opting in to percent-encoding / and \. The storage lock-order note says the Project lock step applies to workspace writers only.
…hind the directory holder
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 166 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
|
@greptile |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 166 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
…d run budget Project version cleanup commits one transaction per batch. An unbudgeted run isolates a failing owner, which reported zero rows even when batches before the failure had committed, so later owners received the full remaining limit again. Cleanup now charges each committed batch to one RowBudget shared across the run, matching how archive cleanup decrements its budgets in place.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 166 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.
Turn on auto-fix | Re-trigger cubic
Summary
Execution
paramsmapping, which the Agent handler never runs.Files
delete_between/replace_betweenfailed when the end anchor also appeared before the start.occurrenceselects the start anchor; the end anchor is the first match after it, and the v2 contract, File block, and tool descriptions now say so. An end anchor found only before the start now returnsnot_found(404) instead of a validation error (400). Copilot's edit tool and its streaming preview use the shared implementation instead of two inline copies. Behavior changes for those two callers: a trailing newline in inserted content no longer adds a blank line, and whitespace-only anchors are refused like the File block already refuses them.useResourceFoldersmemoizes on stable query fields.Projects and workspaces
workspace.project_id; operator errors name release v0.9.18 instead of a PR number; the membership migration logs each repaired workspace's workflow ids after the repair commits.chat.user_idand the legacyworkspace_file.uploaded_by(migration 0429, concurrent) for member-removal ownership lookups.RevokeWorkspaceAccessResultdrops an unreachable variant;unresolvedWorkflowsis renamedunresolvedWorkspaceIds.Integrations
WebhookDeploymentConfigurationError, classified in one helper indeploy.ts.safeUrlPathSegment, so./..can't redirect a request to another endpoint.calendarView, not just any Graph URL.LRUCachewith per-entry TTLs, keeping the cap of 100 concurrent token exchanges (an evicted exchange still counts until it settles); limits come from the schema constants.LRUCache. Ashby shares one error extractor. Profile-validation logs record keys only.Realtime
Tables, logs, knowledge
workflow_inputappears under Built-in Tools in the agent tool picker (picker split by base type).FILTER_OPS.File accounting and retention
/are encoded (%2F) instead of rejected; empty and dot-segment ids are still refused.Type of Change
Testing
replace_betweenline ending, resume cancellation-subscription failure, untitled file opened without edits, disabled-image removal past an empty page, archived workflow in logs (not openable, keeps its name).check:migrations, offlinedrizzle-kit generate, artifact regeneration (tool metadata, docs manifest, agent stream docs, integration docs). Full lint, audits, type-check, and integration suites run in CI.Checklist
test-auditauthoring gate)